package com.vhr.mapper;

import com.vhr.VO.EmployeeVO;
import com.vhr.VO.LeaderVO;
import com.vhr.VO.MenuVO;
import com.vhr.entities.Employee;
import com.vhr.entities.EmployeeExample;
import com.vhr.form.EmployeeForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper

public interface EmployeeMapper {

    /**
     * 查询信息到员工修改页面
     * @param empId
     * @return
     */
    EmployeeForm selectEditPage(Integer empId);

    /**
     * 根据部门和员工状态查询员工信息
     * @return
     */
    List<EmployeeVO> selectByDeptAndStatusAndName(@Param("deptId")Integer deptId,@Param("status")Integer status,@Param("empName")String empName);

    /*
    * 查询所有员工
    * @return
    * */
    List<EmployeeVO> selectAll();

    //员工编号生成使用
    Integer selectMaxId();
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int countByExample(EmployeeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int deleteByExample(EmployeeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int deleteByPrimaryKey(Integer empId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int insert(Employee record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int insertSelective(Employee record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    List<Employee> selectByExample(EmployeeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    Employee selectByPrimaryKey(Integer empId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int updateByExample(@Param("record") Employee record, @Param("example") EmployeeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int updateByPrimaryKeySelective(Employee record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table employee
     *
     * @mbggenerated Wed Sep 25 10:13:45 CST 2019
     */
    int updateByPrimaryKey(Employee record);

    int countByEmpBirth(@Param("left") Integer left,@Param("right") Integer right);
    List<MenuVO> getEmpByDeptId(Integer deptId);
    //获取10个负责人
    List<LeaderVO> getLeaders();
    //根据负责人名字返回
    int getEmpIdByLeaderName(String empName);
}